﻿<UserControl x:Class="Projecturo.ProjecturoClient.View.MilestoneView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:tk="http://schemas.microsoft.com/wpf/2008/toolkit"
    Height="Auto" Width="Auto">
    <DockPanel LastChildFill="True" >
        <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom">
            <Button Content="Save" Command="{Binding SaveCommand}"/> 
        </StackPanel>
        <GroupBox Header="Detail" DockPanel.Dock="Top">
            <StackPanel>
                <TextBlock Text="Project"/>
                <TextBlock Text="{Binding Project.Name}"/>
                <TextBlock Text="Name"/>
                <TextBox Text="{Binding Name}"/>
                <TextBlock Text="Description"/>
                <TextBox Text="{Binding Description}" MinLines="10" AcceptsReturn="True" AcceptsTab="True"/>
                <TextBlock Text="Finishing Date"/>
                <tk:DatePicker SelectedDate="{Binding FinishingDate}"/>
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Tickets for this Milestone">
            <ListView ItemsSource="{Binding Tickets}">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Header="Id" DisplayMemberBinding="{Binding Id}"/>
                        <GridViewColumn CellTemplate="{StaticResource EditTicketTemplate}" Header="Name"/>
                        <GridViewColumn Header="Version" DisplayMemberBinding="{Binding Version.Name}"/>
                        <GridViewColumn Header="Category" DisplayMemberBinding="{Binding Category.Name}"/>
                        <GridViewColumn Header="Milestone" DisplayMemberBinding="{Binding Milestone.Name}"/>
                        <GridViewColumn CellTemplate="{StaticResource DashboardTicketStateStyle}" Header="Status"/>
                        <GridViewColumn Header="Editor" DisplayMemberBinding="{Binding AssignedTo.ShortName}"/>
                        <GridViewColumn Header="Reporter" DisplayMemberBinding="{Binding CreatedBy.ShortName}"/>
                        <GridViewColumn Header="Last Change" DisplayMemberBinding="{Binding Path=ChangeDate,StringFormat={}{0:d}}"/>
                    </GridView>
                </ListView.View>
            </ListView>
        </GroupBox>
    </DockPanel>
</UserControl>
